package cn.itsource.itsource.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

//@Data
public class Department {
@ApiModelProperty(value = "自增长主键")
  private long id;
  @ApiModelProperty(value = "sn编号")
  private String sn;
  @ApiModelProperty(value = "部门名")
  private String name;
  private long state;
  private long managerId;
  private long parentId;

  private String parentName;
  private String managerName;

  @JsonInclude(value = JsonInclude.Include.NON_EMPTY)//为空的时候 不返还json格式数据 百度上面搜索复制过来的
  private List<Department> children=new ArrayList<>();//这个是保存每个部门所有的下级部门


  public List<Department> getChildren() {
    return children;
  }

  public void setChildren(List<Department> children) {
    this.children = children;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getSn() {
    return sn;
  }

  public void setSn(String sn) {
    this.sn = sn;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public long getState() {
    return state;
  }

  public void setState(long state) {
    this.state = state;
  }

  public long getManagerId() {
    return managerId;
  }

  public void setManagerId(long managerId) {
    this.managerId = managerId;
  }

  public long getParentId() {
    return parentId;
  }

  public void setParentId(long parentId) {
    this.parentId = parentId;
  }

  public String getParentName() {
    return parentName;
  }

  public void setParentName(String parentName) {
    this.parentName = parentName;
  }

  public String getManagerName() {
    return managerName;
  }

  public void setManagerName(String managerName) {
    this.managerName = managerName;
  }

  @Override
  public String toString() {
    return "Department{" +
            "id=" + id +
            ", sn='" + sn + '\'' +
            ", name='" + name + '\'' +
            ", state=" + state +
            ", managerId=" + managerId +
            ", parentId=" + parentId +
            ", parentName='" + parentName + '\'' +
            ", managerName='" + managerName + '\'' +
            '}';
  }
}
